Skip to content

[codex] namespace sleep under clock - #29907

Merged
rka-oai merged 1 commit into
mainfrom
codex/clock-sleep
Jun 25, 2026
Merged

[codex] namespace sleep under clock#29907
rka-oai merged 1 commit into
mainfrom
codex/clock-sleep

Conversation

@rka-oai

@rka-oai rka-oai commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose the interruptible sleep tool as clock.sleep instead of top-level sleep
  • keep clock.curr_time and clock.sleep in the same model-visible namespace when both features are enabled
  • update existing core and app-server integration coverage to issue namespaced sleep calls

Why

Sleep is a clock operation. Grouping it with clock.curr_time gives the model a more coherent tool surface without changing the sleep feature gate or runtime behavior.

Validation

  • just test -p codex-core sleep_tool_follows_feature_gate
  • just test -p codex-core any_new_input_interrupts_sleep
  • just test -p codex-app-server sleep_emits_started_and_completed_items

@rka-oai
rka-oai marked this pull request as ready for review June 24, 2026 23:38
@rka-oai
rka-oai requested a review from a team as a code owner June 24, 2026 23:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b512044faf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

impl ToolExecutor<ToolInvocation> for SleepHandler {
fn tool_name(&self) -> ToolName {
ToolName::plain(SLEEP_TOOL_NAME)
ToolName::namespaced(NAMESPACE, TOOL_NAME)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve legacy sleep hook matching

When hooks are enabled and a user already has a PreToolUse/PostToolUse matcher for sleep, this rename changes the hook-facing name from sleep to clocksleep: the default function hook payload uses flat_tool_name(&invocation.tool_name), and the hook engine matches only that canonical name plus explicit aliases. Because SleepHandler does not add a sleep matcher alias, existing hooks that used to audit or block the sleep tool stop running as soon as the model calls the new clock.sleep; please preserve sleep as a matcher alias or override the hook payload while keeping the model-visible namespace.

Useful? React with 👍 / 👎.

@rka-oai
rka-oai merged commit 8005292 into main Jun 25, 2026
31 checks passed
@rka-oai
rka-oai deleted the codex/clock-sleep branch June 25, 2026 00:17
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants